import http from "./request"; //记得引入进来

class RecommendService extends http {
  constructor() {
    super();
    this.baseUrl = "/recommend"
  }

  // 发起联系请求
  sendInvite(body) {
    return this.http({
      method: "post",
      url: "/sendInvite",
      body,
    }, {
      loading: true
    });
  }
  // 获取所有互选的请求
  acceptAllContact(body) {
    return this.http({
      method: 'get',
      url: '/acceptAllContact',
      body
    }, {
      loading: true
    });
  }

  // 获取收到的联系请求
  getContactList(body) {
    return this.http({
      method: 'get',
      url: '/getContactList',
      body
    }, {
      loading: true
    });
  }
  //  获取自己发起的联系列表
  getSendContact(body) {
    return this.http({
      method: 'get',
      url: '/getSendContact',
      body
    },
      {
        loading: true
      });
  }

  // 接受收到的联系请求
  acceptContact(body) {
    return this.http({
      method: 'post',
      url: '/acceptContact',
      body
    }, {
      loading: true
    });
  }

  // 拒绝联系
  refuseContact(body) {
    return this.http({
      method: 'get',
      url: '/refuseContact',
      body
    }, {
      loading: true
    });
  }

  // 撤回申请
  withdraw(body) {
    return this.http({
      method: 'get',
      // 撤回申请
      url: '/withdraw',
      body
    },
      {
        loading: true
      });
  }

  // 获得所有联系
  allContact(body) {
    return this.http({
      method: 'get',
      url: '/allContact',
      body
    },
      {
        loading: true
      });
  }

}

export default new RecommendService();